package com.guoxianwei.scm.domain;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class Menu implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = -1666192727797229382L;
	private int menuid;
	private String menuno;
	private String name;
	private String res_type;
	private String res_string;
	private String icon;
	private String descn;
	private int parentid;
	private String isleaf;

	private List<Menu> children;

	public List<Menu> getChildren() {
		return children;
	}

	public void addChildMenu(Menu child) {
		if (children == null) {
			children = new ArrayList<Menu>();
		}
		children.add(child);
	}

	public void setChildren(List<Menu> children) {
		this.children = children;
	}

	public String getIsleaf() {
		return isleaf;
	}

	public void setIsleaf(String isleaf) {
		this.isleaf = isleaf;
	}

	public int getMenuid() {
		return menuid;
	}

	public String getMenuno() {
		return menuno;
	}

	public void setMenuno(String menuno) {
		this.menuno = menuno;
	}

	public void setMenuid(int menuid) {
		this.menuid = menuid;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getRes_type() {
		return res_type;
	}

	public void setRes_type(String res_type) {
		this.res_type = res_type;
	}

	public String getRes_string() {
		return res_string;
	}

	public void setRes_string(String res_string) {
		this.res_string = res_string;
	}

	public String getIcon() {
		return icon;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}

	public String getDescn() {
		return descn;
	}

	public void setDescn(String descn) {
		this.descn = descn;
	}

	public int getParentid() {
		return parentid;
	}

	public void setParentid(int parentid) {
		this.parentid = parentid;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + menuid;
		result = prime * result + ((menuno == null) ? 0 : menuno.hashCode());
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (!(obj instanceof Menu))
			return false;
		Menu other = (Menu) obj;
		if (menuid != other.menuid)
			return false;
		if (menuno == null) {
			if (other.menuno != null)
				return false;
		} else if (!menuno.equals(other.menuno))
			return false;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		return true;
	}

}
